home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C++ / Frameworks / Sprocket Framework DR2 / Sprocket Framework Interfaces / AGFile.h < prev    next >
Text File  |  1996-06-12  |  4KB  |  164 lines

  1. /***************************************************************************************
  2.  
  3.     File:        AGFile.h
  4.  
  5.     Contains:    Public interface to Apple Guide Database Files.
  6.                 Does not use or require the Apple Guide extension.
  7.  
  8.     Written by:    John R. Powers, III
  9.  
  10.     Copyright:    ©1994 by Apple Computer, Inc. All rights reserved.
  11.  
  12.     Change History (most recent first):
  13.     
  14.     <3>        27-Aug-94 JRP    Make file conforming by removing tag from #endif statement.
  15.                             Add #ifdef __cplusplus.
  16.                             Change AGFileDBMenuNamePtr from ConstStr63Param to Str63.
  17.     <2>        23-Mar-94 JRP    Add:
  18.                                 AGFileGetHelpMenuAppCreator
  19.                                 AGFileGetMixinMatchSelector
  20.                                 AGFileGetHelpMenuBalloonText
  21.     <1>        24-Jan-94 JRP    Initial check-in
  22.  
  23. ***************************************************************************************/
  24.  
  25. #ifndef __AGFILE__
  26. #define __AGFILE__
  27.  
  28. #ifndef __FILES__
  29.     #include <Files.h>
  30. #endif
  31.  
  32. #ifndef __TYPES__
  33.     #include <Types.h>
  34. #endif
  35.  
  36.             // typedef's
  37.  
  38. typedef FSSpec AGFileFSSpecType;
  39. typedef short AGFileSelectorCountType;
  40. typedef short AGFileSelectorIndexType;
  41. typedef OSType AGFileSelectorType;
  42. typedef long AGFileSelectorValueType;
  43. typedef short AGFileDBType;
  44. typedef Str63 AGFileDBMenuNamePtr;
  45. typedef short AGFileDBScriptType;
  46. typedef short AGFileDBRegionType;
  47. typedef short AGFileMajorRevType;
  48. typedef short AGFileMinorRevType;
  49. typedef short AGFileCountType;
  50.  
  51.             // Database types (for AGFileDBType parameter).
  52.  
  53. enum
  54. {
  55.     kAGFileDBTypeAny =            0,
  56.     kAGFileDBTypeHelp =            1,
  57.     kAGFileDBTypeTutorial =        2,
  58.     kAGFileDBTypeShortcuts =    3,
  59.     kAGFileDBTypeAbout =        4,
  60.     kAGFileDBTypeOther =        8
  61. };
  62.  
  63.             // Functions.
  64.  
  65. #ifdef __cplusplus
  66. extern "C" {
  67. #endif
  68.         // Get the database menu item name.
  69. pascal OSErr
  70. AGFileGetDBMenuName(AGFileFSSpecType *fileSpec,
  71.                     AGFileDBMenuNamePtr menuItemNameString);
  72.  
  73.         // Get the database type.
  74. pascal OSErr
  75. AGFileGetDBType(AGFileFSSpecType *fileSpec,
  76.                 AGFileDBType *databaseType);
  77.  
  78.         // Get the version of the software
  79.         // that created this database.
  80. pascal OSErr
  81. AGFileGetDBVersion(AGFileFSSpecType *fileSpec,
  82.                     AGFileMajorRevType *majorRev,
  83.                     AGFileMinorRevType *minorRev);
  84.  
  85.         // Get the database script and region information.
  86. pascal OSErr
  87. AGFileGetDBCountry(AGFileFSSpecType *fileSpec,
  88.                     AGFileDBScriptType *script,
  89.                     AGFileDBRegionType *region);
  90.  
  91.         // Return the number of selectors in database.
  92. pascal AGFileSelectorCountType
  93. AGFileGetSelectorCount(AGFileFSSpecType *fileSpec);
  94.  
  95.         // Get the i-th database selector (1 to AGFileSelectorCountType)
  96.         // and its value.
  97. pascal OSErr
  98. AGFileGetSelector(AGFileFSSpecType *fileSpec,
  99.                     AGFileSelectorIndexType selectorNumber,
  100.                     AGFileSelectorType *selector,
  101.                     AGFileSelectorValueType *value);
  102.  
  103.         // Return true if database is mixin.
  104. pascal Boolean
  105. AGFileIsMixin(AGFileFSSpecType *fileSpec);
  106.  
  107.         // Return the number of database files
  108.         // of the specified databaseType and main/mixin.
  109.         // Any file creator is acceptible,
  110.         // but type must be kAGFileMain or kAGFileMixin.
  111. pascal AGFileCountType
  112. AGFileGetDBCount(short vRefNum,
  113.                     long dirID,
  114.                     AGFileDBType databaseType,
  115.                     Boolean wantMixin);
  116.  
  117.         // Get the FSSpec for the dbIndex-th database
  118.         // of the specified databaseType and main/mixin.
  119.         // Any file creator is acceptible,
  120.         // but type must be kAGFileMain or kAGFileMixin.
  121. pascal OSErr
  122. AGFileGetIndDB(short vRefNum,
  123.                 long dirID,
  124.                 AGFileDBType databaseType,
  125.                 Boolean wantMixin,
  126.                 short dbIndex,
  127.                 FSSpec *fileSpec);
  128.  
  129.         // This selector must match with the application
  130.         // creator in order for this file to appear in the 
  131.         // application's Help menu. Ignored for mixin files
  132.         // because they never appear in the Help menu anyway.
  133.         // If empty (zeros), will appear in the Help menu
  134.         // of any host application.
  135. pascal OSErr
  136. AGFileGetHelpMenuAppCreator(AGFileFSSpecType *fileSpec,
  137.                                 OSType *helpMenuAppCreator);
  138.  
  139.         // This selector must match in the main and mixin
  140.         // files in order for the mixin to mix-in with the main.
  141.         // Empty (zeros) selectors are valid matches.
  142.         // A '****' selector will mix-in with any main.
  143. pascal OSErr
  144. AGFileGetMixinMatchSelector(AGFileFSSpecType *fileSpec,
  145.                                 OSType *mixinMatchSelector);
  146.  
  147.         // This is the text of the balloon for the
  148.         // Help menu item for this database.
  149. pascal OSErr
  150. AGFileGetHelpMenuBalloonText(AGFileFSSpecType *fileSpec,
  151.                                 Str255 helpMenuBalloonString);
  152.  
  153.  
  154. OSErr
  155. AGGetSystemDB(AGFileDBType databaseType, Boolean wantMixin,
  156.                         FSSpec *pFileSpec);
  157.  
  158. #ifdef __cplusplus
  159. }
  160. #endif
  161.  
  162. #endif // __AGFILE__
  163.  
  164.